package yz.cp.back.s.service;

import com.baomidou.mybatisplus.extension.service.IService;
import yz.cp.back.s.entity.SysDepartment;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author jobob
 * @since 2019-04-03
 */
public interface ISysDepartmentService extends IService<SysDepartment> {
    /**
     * 通过父id获取 升序
     * @param parentId
     * @return
     */
    List<SysDepartment> findByParentIdOrderBySortOrder(String parentId);

    /**
     * 通过父id获取 升序 数据权限
     * @param parentId
     * @param departmentIds
     * @return
     */
    List<SysDepartment> findByParentIdAndIdInOrderBySortOrder(String parentId, List<String> departmentIds);

    /**
     * 通过父id和状态获取 升序
     * @param parentId
     * @param status
     * @return
     */
    List<SysDepartment> findByParentIdAndStatusOrderBySortOrder(String parentId, Integer status);

    /**
     * 部门名模糊搜索 升序
     * @param title
     * @return
     */
    List<SysDepartment> findByTitleLikeOrderBySortOrder(String title);

    /**
     * 部门名模糊搜索 升序 数据权限
     * @param title
     * @param departmentIds
     * @return
     */
    List<SysDepartment> findByTitleLikeAndIdInOrderBySortOrder(String title, List<String> departmentIds);
}
